﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;        //For Reading / Writing File
using System.Threading;



namespace WindowsFormsApplication1
{
    
    public partial class Admin_Form : Form
    {
        
        public void SplashScreen()
        {
            Application.Run(new SplashScreen());
        }
        


        public Admin_Form()
        {
            Thread splash = new Thread(new ThreadStart(SplashScreen));
            splash.Start();
            Thread.Sleep(5000);
            InitializeComponent();
            splash.Abort();

        }


        private void addUsersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddUser frmAddUser = new AddUser();
            frmAddUser.MdiParent = this;
            frmAddUser.Show();   
        }

        private void showProductsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
            
        }

        private void showUsersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
        }

        private void addProductsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Add_Product frmAddProduct = new Add_Product();
            frmAddProduct.MdiParent = this;
            frmAddProduct.Show();
        }

        private void Admin_Form_Load(object sender, EventArgs e)
        {
            //Read the Database Configuration from the Resourcefile
            
        }

        private void editProductsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
        }

        private void addProductToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Add_Product new_add_product = new Add_Product();
            new_add_product.MdiParent = this;
            new_add_product.Show();
        }

        private void editUsersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddUser new_adduser = new AddUser();
            new_adduser.MdiParent = this;
            new_adduser.Show();
        }

        private void databaseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Database_Info databaseinfo = new Database_Info();
            databaseinfo.MdiParent = this;
            databaseinfo.Show();
        }

        private void editUsersToolStripMenuItem1_Click(object sender, EventArgs e)
        {
                EditUsers edituser = new EditUsers();
                edituser.MdiParent = this;
                edituser.Show();
        }

        

        private void closeAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form form in this.MdiChildren)
            {
                form.Close();
                
            }
        }

        private void cascadeToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            this.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade);
        }

        private void tileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal);
        }

        private void tileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical);
        }

        private void testModeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            

        }

        private void editProductToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EditProduct editproduct = new EditProduct();
            editproduct.MdiParent = this;
            editproduct.Show();
            
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            
        }

        private void productInventoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ProductInventory productinventory = new ProductInventory();
            productinventory.MdiParent = this;
            productinventory.Show();
        }

        private void salesAnalysisToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SalesAnalysis salesanalysis = new SalesAnalysis();
            salesanalysis.MdiParent = this;
            salesanalysis.Show();
        }

        private void salesReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SalesReport salesreport = new SalesReport();
            salesreport.MdiParent = this;
            salesreport.Show();
        }

        

       
    }
}
